//
//  LocalModel.m
//  pickDataDemo
//
//  Created by dllo on 16/09/10
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "LocalModel.h"
#import "LocalItem.h"

@implementation LocalModel

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    NSMutableArray<LocalItem *> *items = [NSMutableArray array];
    if ([key isEqualToString:@"Items"]) {
        for (NSDictionary *dic in value) {
            LocalItem *item = [LocalItem modelWithDic:dic];
            [items addObject:item];
        }
        _Items = items;
    }
}

+ (NSDictionary *)objectClassInArray{
    return @{@"Items" : [LocalItem class]};
}

@end
